package com.projectmanagement.server.controller;


import com.projectmanagement.server.dao.entity.bo.PageObject;
import com.projectmanagement.server.service.serviceImpl.PlanService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @description
 * @author 星空梦语
 * @date 2021/3/9 下午4:08
 */
@Controller
@RequestMapping("/plan")
public class PlanController {

    @Resource
    private PlanService planService;


    /**
     * @description
     * @author 星空梦语
     * @date 2021/3/9 下午4:08
     */
    @ResponseBody
    @RequestMapping(value = "/queryAll",produces = "application/json;charset=utf-8")
    public String queryAll(HttpServletRequest request,@RequestBody PageObject pageObject) throws Exception {
        return planService.queryAll(request,pageObject);
    }


    /**
     * @description
     * @author 星空梦语
     * @date 2021/3/9 下午4:08
     */
    @ResponseBody
    @RequestMapping(value = "/edit",produces = "application/json;charset=utf-8")
    public void edit(@RequestBody String data) throws Exception {
        planService.editData(data);
    }


    /**
     * @description
     * @author 星空梦语
     * @date 2021/3/9 下午4:08
     */
    @ResponseBody
    @RequestMapping(value = "/saveMindCase",produces = "application/json;charset=utf-8")
    public String saveMindCase(@RequestBody PageObject pageObject) throws Exception {
        return planService.saveMindCase(pageObject);
    }


    /**
     * @description
     * @author 星空梦语
     * @date 2021/3/9 下午4:08
     */
    @ResponseBody
    @RequestMapping(value = "/queryMindCase",produces = "application/json;charset=utf-8")
    public String queryMindCase(@RequestBody PageObject pageObject) throws Exception {
        return  planService.queryMindCase(pageObject);
    }



}
